Skip to content

fix: rename partially "Triple" to "Tuple" to reflect the new terminology (pt.2)#4834

Open
motorailgun wants to merge 5 commits intorust-lang:mainfrom
motorailgun:triple-tuple
Open

fix: rename partially "Triple" to "Tuple" to reflect the new terminology (pt.2)#4834
motorailgun wants to merge 5 commits intorust-lang:mainfrom
motorailgun:triple-tuple

Conversation

@motorailgun
Copy link
Copy Markdown
Contributor

@motorailgun motorailgun commented Apr 26, 2026

Partial effort to #4826, and continuous to #4827.

This PR still does not do functionality changes. Opening as draft PR to rely on CI for Windows-only cfgs. <- fixed!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the terminology migration from “Triple” to “Tuple” (part 2 of the effort), updating types, modules, and user-facing strings without intending behavioral changes.

Changes:

  • Renames TargetTriple/PartialTargetTriple to TargetTuple/PartialTargetTuple across core dist/config/CLI flows.
  • Moves the generated “known targets” list from dist/triple to dist/tuple and updates the generator test accordingly.
  • Updates CLI prompts, logs, and tests/snapshots to say “tuple” instead of “triple”.

Reviewed changes

Copilot reviewed 15 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/suite/known_tuples.rs Updates generator test to target the new src/dist/tuple/known.rs and renames parser helper.
tests/suite/cli_v2.rs Updates tests to use TargetTuple in manifest manipulation.
tests/suite/cli_rustup.rs Renames tests and expected stderr text from “triple” to “tuple”.
tests/suite/cli_inst_interactive.rs Updates interactive installer snapshots/prompts from “host triple” to “host tuple”.
src/toolchain/names.rs Switches resolver APIs and test imports to TargetTuple / tuple::known.
src/toolchain.rs Changes installed-target parsing to return TargetTuple.
src/test/dist.rs Updates mock dist server to construct/insert TargetTuple keys/values.
src/test.rs Updates host detection helper to use TargetTuple::from_host.
src/errors.rs Re-types error fields from TargetTriple to TargetTuple.
src/dist/tuple/known.rs Adds the generated known arch/os/env lists under the new tuple module.
src/dist/tuple.rs Renames PartialTargetTriple to PartialTargetTuple and updates tests/docs accordingly.
src/dist/mod.rs Replaces triple module with tuple, renames TargetTriple to TargetTuple, and updates associated logic/tests.
src/dist/manifestation/tests.rs Updates manifestation tests to construct components with TargetTuple.
src/dist/manifestation.rs Renames manifestation target field to target_tuple and updates comparisons and lookup logic.
src/dist/manifest.rs Switches manifest target maps/components and (de)serialization helpers to TargetTuple.
src/config.rs Updates config flows to use TargetTuple (including default host resolution and checks).
src/cli/setup_mode.rs Renames install option field to default_host_tuple.
src/cli/self_update/windows.rs Updates Windows self-update MSVC checks to use tuple terminology/types.
src/cli/self_update.rs Renames install options field/prompt/logging to “tuple” and updates host/build tuple usage.
src/cli/rustup_mode.rs Updates CLI logic to use TargetTuple for host/target checks and target add/remove.
src/cli/common.rs Updates shared CLI helpers to accept/use TargetTuple.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

View changes since this review

Comment thread src/cli/rustup_mode.rs
Comment thread src/cli/self_update/windows.rs Outdated
Comment thread src/dist/mod.rs Outdated
Comment thread tests/suite/known_tuples.rs Outdated
Copy link
Copy Markdown
Member

@rami3l rami3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo one tiny nit, nice work :]

View changes since this review

Comment thread src/dist/mod.rs

pub(crate) fn has_triple(&self) -> bool {
pub(crate) fn has_tuple(&self) -> bool {
self.target.arch.is_some() || self.target.os.is_some() || self.target.env.is_some()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Pre-existing, but I think you can extract before this commit a PartialTargetTriple::is_empty() helper, and then inline all uses of this function to !desc.target.is_empty(). That way the level of abstraction feels more correct and the overall logic is more readable to me... What do you think?

Copy link
Copy Markdown
Contributor Author

@motorailgun motorailgun Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah that feels better especially because it is checking/digging self.target. Will look into more and fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants